package com.ff.xyh.access.controller.complaint;

import com.ff.xyh.access.service.complaint.ComplaintFeignService;
import com.ff.xyh.common.entity.complaint.ComplaintHandle;
import com.ff.xyh.common.entity.complaint.ComplaintInfo;
import com.ff.xyh.common.entity.result.ResultObject;
import com.ff.xyh.common.qo.complaint.ComplaintHandleQuery;
import com.ff.xyh.common.qo.complaint.ComplaintInfoQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther FF
 * @Date 2023年 05月 23日
 * @Time 21:50
 */

@Api(tags = "举报管理接口")
@RestController
@RequestMapping("/access/complaint")
public class ComplaintController {

    @Autowired
    private ComplaintFeignService service;


    @ApiOperation(value = "处理举报信息")
    @PostMapping("handleInfo")
    ResultObject handleComplaintInfo(
            @RequestBody ComplaintHandle complaintHandle) {
        return service.handleComplaintInfo(complaintHandle);
    }

    @ApiOperation(value = "条件查询举报信息列表")
    @PostMapping("info/get/condition")
    ResultObject getComplaintInfoCondition(
            @RequestBody ComplaintInfoQuery complaintInfoQuery) {
        return service.getComplaintInfoCondition(complaintInfoQuery);
    }
    @GetMapping("info/delete/{id}")
    ResultObject deleteComplaintInfo(@PathVariable String id) {
        return service.deleteComplaintInfoById(id);
    }

//    @PostMapping("info/add")
//    ResultObject addComplaintInfo(
//            @RequestBody ComplaintInfo complaintInfo) {
//        return service.addComplaintInfo(complaintInfo);
//    }

    @PostMapping("info/modify")
    ResultObject modifyComplaintInfoById(
            @RequestBody ComplaintInfo complaintInfo) {
        return service.modifyComplaintInfo(complaintInfo);
    }

    @ApiOperation(value = "条件查询举报处理列表")
    @PostMapping("handle/get")
    ResultObject getComplaintHandleCondition(
            @RequestBody ComplaintHandleQuery complaintHandleQuery) {
        return service.getComplaintHandleCondition(complaintHandleQuery);
    }
    @GetMapping("handle/delete/{id}")
    ResultObject deleteComplaintHandle(@PathVariable String id) {
        return service.deleteComplaintHandleById(id);
    }
    @PostMapping("handle/add")
    ResultObject addComplaintHandle(
            @RequestBody ComplaintHandle complaintHandle) {
        return service.addComplaintHandle(complaintHandle);
    }
    @PostMapping("handle/modify")
    ResultObject modifyComplaintHandleById(
            @RequestBody ComplaintHandle complaintHandle) {
        return service.modifyComplaintHandle(complaintHandle);
    }


}
